finalplot <- CBC %>% gather(Measurement, Value, names(select_if(.,is.numeric))) %>%
ggplot() +
geom_jitter(aes(x = Treatment, y = Value, color = Treatment),width = 0.2, height = 0.1) +
geom_errorbar(aes(x = Treatment, ymax = mean+sd, ymin = mean-sd, color = Treatment),
width = 0.1, data = CBC_summary, inherit.aes = FALSE, show.legend = FALSE) +
geom_errorbar(aes(x = Treatment, ymax = mean, ymin = mean, color = Treatment),
width = 0.2, data = CBC_summary, inherit.aes = FALSE, show.legend = FALSE) +
geom_text(data = annotations, aes(x = xlab, y = ylab, label = lab)) +
geom_segment(data = annotations, aes(x = x1, xend = x1, y = y1, yend = y2)) +
geom_segment(data = annotations, aes(x = x2, xend = x2, y = y1, yend = y2)) +
geom_segment(data = annotations, aes(x = x1, xend = x2, y = y2, yend = y2)) +
scale_color_manual(values=c("#EB4478","#000000")) +
scale_y_continuous(expand = c(.1,.1)) +
facet_wrap(~ Measurement, scales = "free") +
xlab("Treatment") +
ylab("Values (mean ± SD)") +
ggtitle("Mouse CBC values by treatment") +
gregtheme()
finalplot